package sample.client.event;

import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;

import sample.client.event.SetEnabledEvent.SetEnabledHandler;

public class SetEnabledEvent extends GwtEvent<SetEnabledHandler>
{
  public static Type<SetEnabledHandler> TYPE = new Type<SetEnabledHandler>();
  
  public enum Option { GOTO }

  private Option opt;
  private boolean isEnabled;
  
  public Option getOpt() {
    return opt;
  }
  
  public boolean isEnabled() {
    return isEnabled;
  }

  @Override
  public Type<SetEnabledHandler> getAssociatedType() {
    return TYPE;
  }
  
  public SetEnabledEvent(Option opt, boolean isEnabled) {
    this.opt = opt;
    this.isEnabled = isEnabled;
  }

  @Override
  protected void dispatch(SetEnabledHandler handler) {
    handler.onSetEnabled(this);
  }

  public interface SetEnabledHandler extends EventHandler
  {
    public void onSetEnabled(SetEnabledEvent e);
  }

}
